import { createApp } from 'vue'
import App from './App.vue'

// 引入Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// 引入Bootstrap
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap'

// 引入路由
import router from './router'

// 引入自定义样式
import './assets/base.css'
import './assets/main.css'

import { initOSSClient } from '@/utils/oss'
import { ossConfig } from '@/config/oss'

// 初始化OSS客户端
initOSSClient(ossConfig)

const app = createApp(App)

// 注册Element Plus
app.use(ElementPlus, {
  locale: zhCn,
})
// 注册路由
app.use(router)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')
